// pages/demand-detail/demand-detail.js
const app = getApp()
Page({
  data: {
    detail: null,
	id:'',
    isAuthorized: false
  },

  onLoad(options) {
	console.log(options.id)
    this.loadData(options.id)
	console.log(options.id)
	this.id = options.id
  },

  // 加载详情数据
  async loadData(id) {
    wx.showLoading({ title: '加载中' })
    this.setData({ isLoading: true });
         	var that = this
			console.log('-----------',id)
               app.util.request({
                       url: 'Kangyang/detail',
                       data: {
    					   id:id
                       },
                       success(res) {
                               var data = res.data.data;
         					  console.log(data)
                                that.setData({
                                       detail: {
                                         ...data.kangyang
                                       },
                                       loading: false
                                     });
                       }
               })
  },

  // 图片预览
  previewImage(e) {
    const current = e.currentTarget.dataset.url
    wx.previewImage({
      current,
      urls: [current]
    })
  },
})